﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace JEng_Mark_1.GameComponents
{
    public class JCamera
    {
        private Vector3 _position = Vector3.Zero;
        /// <summary>
        /// Postition of the camera.
        /// </summary>
        public Vector3 Position
        {
            get { return _position; }
            set { _position = value; }
        }

        private float _fieldOfView = MathHelper.Pi / 3.0f;
        /// <summary>
        /// The viewable angle.
        /// </summary>
        public float FieldOfView
        {
            get { return _fieldOfView; }
            set { _fieldOfView = value; }
        }

        private float _nearPlane = 0.1f;
        /// <summary>
        /// The near plane used to determine the viewable area.
        /// </summary>
        public float NearPlane
        {
            get { return _nearPlane; }
            set { _nearPlane = value; }
        }

        private float _farPlane = 3500.0f;
        /// <summary>
        /// The far plane used to determine the viewable area.
        /// </summary>
        public float FarPlane
        {
            get { return _farPlane; }
            set { _farPlane = value; }
        }

        /// <summary>
        /// Slightly smaller viewable field of view for culling.
        /// </summary>
        public float ViewableFieldOfView
        {
            get { return FieldOfView / 1.125f; }
        }

        private Matrix _view;
        /// <summary>
        /// Matrix containing coordinates of the camera.
        /// </summary>
        public Matrix View
        {
            get { return _view; }
            set { _view = value; }
        }

        private Matrix _reflectedView;
        /// <summary>
        /// Reflected View matrix around an arbitrary plane.
        /// </summary>
        public Matrix ReflectedView
        {
            get { return _reflectedView; }
            set { _reflectedView = value; }
        }

        private Matrix _projection;
        /// <summary>
        /// The projection matrix, what can be seen.
        /// </summary>
        public Matrix Projection
        {
            get { return _projection; }
            set { _projection = value; }
        }

        private BoundingFrustum _frustum;
        /// <summary>
        /// The trapezoid that contains everything that the camera can see.
        /// </summary>
        public BoundingFrustum Frustum
        {
            get { return _frustum; }
            set { _frustum = value; }
        }

        private BoundingFrustum _reflectedFrustum;
        /// <summary>
        /// The trapezoid that contains everything that the camera can see if it was reflected.
        /// </summary>
        public BoundingFrustum ReflectedFrustum
        {
            get { return _reflectedFrustum; }
            set { _reflectedFrustum = value; }
        }

        public virtual void Update(GameTime gameTime)
        {

        }

        public virtual void SetPosition(Vector3 newPosition)
        {

        }

        public virtual void Translate(Vector3 move)
        {

        }

        public virtual void RotateX(float angle)
        {

        }

        public virtual void RotateY(float angle)
        {

        }

        public virtual void RotateZ(float angle)
        {

        }

        public virtual void Reset()
        {

        }
    }
}
